(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

g(h(g(x))) → g(x)
g(g(x)) → g(h(g(x)))
h(h(x)) → h(f(h(x), x))

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted CpxTRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(h(g(z0))) → c(G(z0))
G(g(z0)) → c1(G(h(g(z0))), H(g(z0)), G(z0))
H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
S tuples:

G(h(g(z0))) → c(G(z0))
G(g(z0)) → c1(G(h(g(z0))), H(g(z0)), G(z0))
H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
K tuples:none
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c, c1, c2

(3) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
We considered the (Usable) Rules:none
And the Tuples:

G(h(g(z0))) → c(G(z0))
G(g(z0)) → c1(G(h(g(z0))), H(g(z0)), G(z0))
H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(G(x1)) = 0   
POL(H(x1)) = [2]x1   
POL(c(x1)) = x1   
POL(c1(x1, x2, x3)) = x1 + x2 + x3   
POL(c2(x1, x2)) = x1 + x2   
POL(f(x1, x2)) = x2   
POL(g(x1)) = 0   
POL(h(x1)) = [2] + [2]x1   

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(h(g(z0))) → c(G(z0))
G(g(z0)) → c1(G(h(g(z0))), H(g(z0)), G(z0))
H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
S tuples:

G(h(g(z0))) → c(G(z0))
G(g(z0)) → c1(G(h(g(z0))), H(g(z0)), G(z0))
K tuples:

H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c, c1, c2

(5) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace G(g(z0)) → c1(G(h(g(z0))), H(g(z0)), G(z0)) by

G(g(x0)) → c1(G(h(g(x0))), G(x0))

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(h(g(z0))) → c(G(z0))
H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
G(g(x0)) → c1(G(h(g(x0))), G(x0))
S tuples:

G(h(g(z0))) → c(G(z0))
G(g(x0)) → c1(G(h(g(x0))), G(x0))
K tuples:

H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c, c2, c1

(7) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace H(h(z0)) → c2(H(f(h(z0), z0)), H(z0)) by

H(h(x0)) → c2(H(x0))

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(h(g(z0))) → c(G(z0))
G(g(x0)) → c1(G(h(g(x0))), G(x0))
H(h(x0)) → c2(H(x0))
S tuples:

G(h(g(z0))) → c(G(z0))
G(g(x0)) → c1(G(h(g(x0))), G(x0))
K tuples:

H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c, c1, c2

(9) CdtForwardInstantiationProof (BOTH BOUNDS(ID, ID) transformation)

Use forward instantiation to replace G(h(g(z0))) → c(G(z0)) by

G(h(g(h(g(y0))))) → c(G(h(g(y0))))
G(h(g(g(y0)))) → c(G(g(y0)))

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
H(h(x0)) → c2(H(x0))
G(h(g(h(g(y0))))) → c(G(h(g(y0))))
G(h(g(g(y0)))) → c(G(g(y0)))
S tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
G(h(g(h(g(y0))))) → c(G(h(g(y0))))
G(h(g(g(y0)))) → c(G(g(y0)))
K tuples:

H(h(z0)) → c2(H(f(h(z0), z0)), H(z0))
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c1, c2, c

(11) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)

Removed 1 leading nodes:

G(h(g(g(y0)))) → c(G(g(y0)))
Removed 1 trailing nodes:

G(h(g(h(g(y0))))) → c(G(h(g(y0))))

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
H(h(x0)) → c2(H(x0))
S tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
K tuples:none
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c1, c2

(13) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

G(g(x0)) → c1(G(h(g(x0))), G(x0))
We considered the (Usable) Rules:none
And the Tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
H(h(x0)) → c2(H(x0))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(G(x1)) = [4]x1   
POL(H(x1)) = 0   
POL(c1(x1, x2)) = x1 + x2   
POL(c2(x1)) = x1   
POL(g(x1)) = [2] + [2]x1   
POL(h(x1)) = 0   

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:

g(h(g(z0))) → g(z0)
g(g(z0)) → g(h(g(z0)))
h(h(z0)) → h(f(h(z0), z0))
Tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
H(h(x0)) → c2(H(x0))
S tuples:none
K tuples:

G(g(x0)) → c1(G(h(g(x0))), G(x0))
Defined Rule Symbols:

g, h

Defined Pair Symbols:

G, H

Compound Symbols:

c1, c2

(15) SIsEmptyProof (EQUIVALENT transformation)

The set S is empty

(16) BOUNDS(O(1), O(1))